#include "RecogData.h"

void RecogData::fromJson(const QJsonObject& json, QStringList& errorList)
{
    IJsonSerializable::fromJson(json, errorList);
    this->trayNo = json["trayNo"].toString(trayNo);
    this->timestamp = json["timestamp"].toString(timestamp);
    this->col = json["col"].toInt(col);
    this->row = json["row"].toInt(row);
    this->result = json["result"].toString(result);
    this->precise = json["precise"].toInt(precise);
    this->weight = json["weight"].toInt(weight);
}

QJsonObject RecogData::toJson() const
{
    QJsonObject json = IJsonSerializable::toJson();
    json.insert("trayNo", trayNo);
    json.insert("timestamp", timestamp);
    json.insert("col", col);
    json.insert("row", row);
    json.insert("result", result);
    json.insert("precise", precise);
    json.insert("weight", weight);
    return json;
}
